<div class="SipeiInfo pt20">
<?php
    $form = $this->beginWidget('CActiveForm', array(
    'method' => 'POST',
    'id' => 'myform',
    'htmlOptions' => array('name' => 'myform','target' => 'ajax-frame')
    ));
    ?>  
    <table class="fontc_666 height32">
    <tbody>
        <tr height="55">
            <td valign="top" width="125" align="right" class="pr5"><span class="pr5 fontc_orange_red">*</span>角色代码：</td>
            <td valign="top" width="370" class="formValidator_td">
                <input type="text" value="" name="role_code" id='role_code' class="col3 pt5 pr10 pb5 pl10 height20 border_c border_3 fontc_666">
                <div class="formValidator_tip">
                    <p id="role_codeTip" ></p>
                </div>
            </td>
        </tr>
        <tr height="55">
            <td valign="top" align="right" class="pr5"><span class="pr5 fontc_orange_red">*</span>角色名称：</td>
            <td valign="top" class="formValidator_td">
                <input type="text" value="" name="role_name" id='role_name' class="col3 pt5 pr10 pb5 pl10 height20 border_c border_3 fontc_666">
                <div class="formValidator_tip">
                    <p id="role_nameTip" ></p>
                </div>
            </td>
        </tr>
        <tr>
            <td align="right" class="pr5">是否生效：</td>
            <td><input type="checkbox" name="check" checked="checked"></td>
        </tr>
        <tr>
            <td align="right" valign="top" class="pt10 pr5">备注：</td>
            <td class="pt10"><textarea name="content" class="col3 pt6 pr10 pb6 pl10 border_c border_3 fontc_666"></textarea></td>
        </tr>
        <tr>            
            <td colspan="2" align="center" class="pt20 pb20">             
                <input type="submit" value="保存" name="submit" class="b_a_n border_3 back_bgfb w80 height32 fontc_FFF fonts_12 mr10 cursor">
                <input type="button" onclick="api.close()" value="取消" class="b_a_n border_3 back_bgb w80 height32 fontc_FFF fonts_12 cursor">
            </td>
        </tr>
    </tbody>
</table>
</div>
<?php
$this->endWidget();
?>
<iframe src='' style="display:none" name='ajax-frame'></iframe>
<script>
$(function(){
	$.formValidator.initConfig({formID:"myform",theme:"126",submitOnce:false,
	onError:function(msg,obj,errorlist){
		$("#errorlist").empty();
		$.map(errorlist,function(msg){
			$("#errorlist").append("<li>" + msg + "</li>")
		});
		alert(msg);
	},
	ajaxPrompt : '有数据正在异步验证，请稍等...'
	});

	/*角色代码验证*/
	$("#role_code").formValidator({
		onShowText:"请输入角色代码",
		onShow:"",
		onFocus:"",
		onCorrect:"输入正确",
		leftTrim:true,
		rightTrim:true
	}).regexValidator({
		regExp:"^[a-zA-Z]{1,}([0-9]|[a-zA-Z])+$",
		onError:"角色代码格式不正确"
	});


	/*角色名称验证*/
	$("#role_name").formValidator({
		onShowText:"请输入角色名称",
		onShow:"",
		onFocus:"",
		onCorrect:"输入正确",
		leftTrim:true,
		rightTrim:true
	}).inputValidator({
		min:1,
		onError:"角色名称不能为空"
	});

})
</script>
<?php exit; ?>